	.file	1 "interpolate.c"
	.section .mdebug.abi32
	.previous
	.gnu_attribute 4, 3
	.section	.text,code
	.align	2
	.globl	twice_internal
	.set	nomips16
	.set	nomicromips
	.ent	twice_internal
	.type	twice_internal, @function
twice_internal:
	.frame	$sp,0,$31		# vars= 0, regs= 0/0, args= 0, gp= 0
	.mask	0x00000000,0
	.fmask	0x00000000,0
	.set	noreorder
	.set	nomacro
# Begin mchp_output_function_prologue
# End mchp_output_function_prologue

#  $4 num_samples_in
#  $5 *in
#  $6 *out   	

# $14     626
# $13    -149
# $24      42
# $12	32767
# $11   32768
# $25	   -7


	blez	$4,.L9
	li	$14,626			# 0x272

	li	$13,-149			# 0xffffffffffffff6b
	li	$24,42
	li	$25,-7
	li	$12,32767			# 0x7fff
	j	.L6
	li	$11,32768			# 0x8000

.L8:
	addiu	$6,$6,4
.L6:
	mtlo	$0

# - 7*((int_least32_t)in[0]+in[7])
	lh	$8,14($5)  # $8=in[7] 
	lh	$7,0($5)   # $7=in[0]
	addu    $7,$8,$7   # -> $7        
        madd    $7,$25

# + 42*((int_least32_t)in[1]+in[6])
	lh 	$2,2($5)
	lh	$3,12($5)
	addu	$2,$3,$2
	madd    $2,$24

# -149*((int_least32_t)in[2]+in[5])
	lh	$8,4($5)
	lh	$7,12($5)
	addu    $7,$8,$7   # -> $7
	madd    $7,$13

# +626*((int_least32_t)in[3]+in[4])
	lh      $2,6($5)
        lh      $3,8($5)
        addu    $2,$3,$2 
        madd    $2,$14  

	mflo	$2
	addiu   $2,$2,512	
	sra     $2,$2,0xa


	li	$8,-32768			# 0xffffffffffff8000


	slt	$7,$2,$11
	slt	$3,$2,-32768
	bne	$3,$0,.L3
	movz	$2,$12,$7

	seh	$8,$2
.L3:
	sh	$8,0($6)
	lhu	$2,6($5)
	addiu	$4,$4,-1
	bne	$4,$0,.L8
	sh	$2,2($6)

.L9:
	j	$31
	nop

	.set	macro
	.set	reorder
# Begin mchp_output_function_epilogue
# End mchp_output_function_epilogue
	.end	twice_internal
	.size	twice_internal, .-twice_internal
	.ident	"GCC: (Microchip Technology) 4.5.1 MPLAB XC32 Compiler v1.10"
# Begin MCHP vector dispatch table
# End MCHP vector dispatch table
# MCHP configuration words
